/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * <p>Project: jse2204 - Ex1
 * <p>Powered by webrx On 2022-09-28 11:45:33
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex1 {
    public static void main(String[] args) {
        IntStream is = IntStream.rangeClosed(1,100);
        //int s = is.sum();
        //System.out.println(s);
        //is.forEach(System.out::println);
        //is.forEach(System.out::println);


        //生成一个集合，随机5个数

        Random rand = new Random();
        IntStream is2 = IntStream.generate(()->rand.nextInt(1,101)).limit(10);
        //is2.forEach(System.out::println);

        List<Integer> list = is2.boxed().toList();
        System.out.println(list);
    }
}
